package com.zs.diveinspringboot.listener

import org.springframework.context.ApplicationListener
import org.springframework.context.event.ContextRefreshedEvent
import org.springframework.core.Ordered
import org.springframework.core.annotation.Order

/**
 * 监听ContextRefreshedEvent
 * @description
 * @author madison
 * @date 2021/6/5 17:15
 *
 */
@Order(Ordered.HIGHEST_PRECEDENCE)
class HelloWorldApplicationListener : ApplicationListener<ContextRefreshedEvent> {
    override fun onApplicationEvent(event: ContextRefreshedEvent) {
        println("HelloWorld Listener:${event.applicationContext.id}, timestamp:${event.timestamp}")
    }
}